home *** CD-ROM | disk | FTP | other *** search
- uint action_escape = 0x01;
-
-
- geCRenderableObject* g_pThis = 0;
- geCBaseNode* g_pNode = 0;
-
- uint g_MaxLifes = 5;
- int g_uiLifes = g_MaxLifes;
- uint g_uiShtonsCounter = 0;
-
- bool g_bEndLevel = false;
- float g_fStartEndTime = 0.0f;
-
- void IncreaseShtonsCounter( uint a_uiVal )
- {
- g_uiShtonsCounter = g_uiShtonsCounter + a_uiVal;
- }
- void IncreaseShtonsCounter()
- {
- IncreaseShtonsCounter(1);
- //g_uiShtonsCounter = g_uiShtonsCounter + a_uiVal;
- }
- void LevelDecreaseLifes( uint NormalDeath )
- {
- if( g_uiLifes > 0 )
- {
- g_uiLifes = g_uiLifes - 1;
- }
- if( g_uiLifes == 0 )
- {
- EndLevel();
- }
- }
- void LevelDecreaseLifesBy( uint a_uiLifes )
- {
- if( int(g_uiLifes)-int(a_uiLifes) >= 0 )
- {
- g_uiLifes = g_uiLifes - a_uiLifes;
- }
- else
- {
- g_uiLifes = 0;
- }
-
- if( g_uiLifes == 0 )
- {
- EndLevel();
- }
- }
-
- bool LevelIncreaseLifes( uint a_uiCount )
- {
- if( g_uiLifes >= g_MaxLifes )
- return false;
-
- g_uiLifes += a_uiCount;
- if( g_uiLifes > g_MaxLifes )
- g_uiLifes = g_MaxLifes;
- return true;
- }
-
- void EndLevel()
- {
- if( !g_bEndLevel )
- {
- GameCore->SendMessage( String("stop"), g_pNode->GetID(), g_pNode->GetID(), 666, 0 );
-
- geCBaseNode* pKoniecSplashNode = GameCore->GetRootNode()->GetNodeByName( String("HudKoniec") );
- pKoniecSplashNode->Enable(1);
- GetRenderableObject(pKoniecSplashNode)->GetAnimations()->SetActive(1);
- g_bEndLevel = true;
- g_fStartEndTime = -666.666f;
- }
- }
-
-
- void geCRenderableObject_Update( geSUpdateArgument* a_pArg )
- {
- if( g_pNode->IsFistTimeUpdate() == TRUE )
- {
- g_pThis->PlayMusiqueByName( String("simus_bg_music") );
- }
- LogToScreen( "PunktyFont", 0.1f, 0.015f, bstrFormat( g_uiLifes ) );
- LogToScreen( "PunktyFont", 0.8f, 0.015f, bstrFormat( g_uiShtonsCounter ) );
-
- if( g_fStartEndTime == -666.666f && g_bEndLevel )
- {
- g_fStartEndTime = a_pArg->m_fCurrentTime;
- }
- else if( g_bEndLevel && a_pArg->m_fCurrentTime - g_fStartEndTime >= 5.0f )
- {
- g_pNode->Disable(1);
- GameCore->UnloadLevel();
- GameCore->GetRootNode()->GetNodeByName( String("MainScreen2") )->Enable(1);
- }
-
- bool bLast = false;
- if( GameCore->CheckForKey( GameCore->back_to_menu, bLast ) && !bLast /*&& !IsShowingMap()*/ )
- {
- EndLevel();
- }
- /*
- if( GameCore->CheckForKey(action_escape) && !g_bEndLevel )
- {
- EndLevel();
- }
- */
-
- return;
- }
-
- void geCRenderableObject_Process( geSUpdateArgument* a_pArg )
- {
- return;
- }
-
- void main( geCBaseNode* a_pNode )
- {
- g_pNode = a_pNode;
- g_pThis = GetRenderableObject( a_pNode );
- }
-
-